// import com.alibaba.druid.sql.ast.SQLName;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor;

// import java.util.ArrayList;
// import java.util.List;
#pragma once

#include <string>
#include <list>

#include "../SQLExpr.h"
#include "../SQLExprImpl.h"
#include "../Object.h"
#include "../SQLName.h"

#include "../../../utils/enumdecl.h"
// #include "../../visitor/SQLASTVisitor.h"

#include "SQLConstraintImpl.h"
#include "SQLForeignKeyConstraint.h"
class SQLASTVisitor;

// 声明一个枚举
class SQLForeignKeyImpl_Match
{
public:
  static SQLForeignKeyImpl_Match FULL;
  static SQLForeignKeyImpl_Match PARTIAL;
  static SQLForeignKeyImpl_Match SIMPLE;

  SQLForeignKeyImpl_Match() {}
  SQLForeignKeyImpl_Match(uint64_t mask, string_ptr name);

  string_ptr name;
  string_ptr nameLCase;
  uint64_t mask;
};

class SQLForeignKeyImpl_On
{
public:
  static SQLForeignKeyImpl_On DELETE;
  static SQLForeignKeyImpl_On UPDATE;

  SQLForeignKeyImpl_On(uint64_t mask, string_ptr name);

  string_ptr name;
  string_ptr nameLCase;
  uint64_t mask;
};

class SQLForeignKeyImpl_Option
{
public:
  static SQLForeignKeyImpl_Option RESTRICT;
  static SQLForeignKeyImpl_Option CASCADE;
  static SQLForeignKeyImpl_Option SET_NULL;
  static SQLForeignKeyImpl_Option NO_ACTION;
  static SQLForeignKeyImpl_Option SET_DEFAULT;

  SQLForeignKeyImpl_Option() {}
  SQLForeignKeyImpl_Option(uint64_t mask, string_ptr name);

  string_ptr name;
  string_ptr nameLCase;
  uint64_t mask;
};

class SQLForeignKeyImpl : virtual public SQLConstraintImpl,
                          virtual public SQLForeignKeyConstraint
{
public:
  SQLExprTableSource_ptr referencedTable;
  SQLName_list_ptr referencingColumns;
  SQLName_list_ptr referencedColumns;
  BOOL_ptr onDeleteCascade;
  BOOL_ptr onDeleteSetNull;
  BOOL_ptr disableNovalidate;

  SQLForeignKeyImpl();
  SHAREDOBJECT(SQLForeignKeyImpl) ;
  SQLName_list_ptr getReferencingColumns();

  SQLExprTableSource_ptr getReferencedTable();

  SQLName_ptr getReferencedTableName();

  void setReferencedTableName(SQLName_ptr value);

  void setReferencedTable(SQLExprTableSource_ptr x);

  SQLName_list_ptr getReferencedColumns();

  BOOL_ptr isOnDeleteCascade();

  void setOnDeleteCascade(BOOL_ptr onDeleteCascade);

  BOOL_ptr isOnDeleteSetNull();

  void setOnDeleteSetNull(BOOL_ptr onDeleteSetNull);

  BOOL_ptr isDisableNovalidate();

  void setDisableNovalidate(BOOL_ptr disableNovalidate);

  void accept0(SQLASTVisitor_ptr visitor) override;

  void cloneTo(SQLForeignKeyImpl_ptr x);

  virtual SQLObject_ptr clone();
};
